#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "oracle.h"
#include "fuzzykmeans.h"

#define re register int 
#define in inline
#define maxn 300005
#define N    30425

int n,k;

double V[maxn]={0,0,0,1,1,0.5};
double C[maxn]={-1,0,2,1};
int main(int argc,char *argv[])
{
    	n=atoi(argv[1]),k=atoi(argv[2]);
    	//printf("%d %d\n",n,k);
	oracle(V,0,n);
	double mix,mxx,miy,mxy;
	mix=miy=100005,mxx=mxy=-mix;
	re i;
	for(i=0;i<2*n;i+=2) mix=fmin(mix,V[i]),mxx=fmax(mxx,V[i]),miy=fmin(miy,V[i+1]),mxy=fmax(mxy,V[i+1]);
	for(i=0;i<2*k;i++){
		C[i]=mix+(mxx-mix)*(rand()%N)/N;
		C[i+1]=miy+(mxy-miy)*(rand()%N)/N;
	}
	fuzzykmeans(V,n,C,k);
	for(i=0;i<2*n;i++) printf("%.2lf\n",V[i]);
	for(i=0;i<2*k;i++) printf("%.2lf\n",C[i]);
	return 0;
}
/*



*/

